# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=qxmpp
pkgver=1.3.1
pkgrel=0
pkgdesc="Cross-platform C++ XMPP client and server library"
arch="all"
url="https://github.com/qxmpp-project/qxmpp"
license="LGPL-2.1"
makedepends="cmake qt5-qtbase-dev"
source="https://github.com/qxmpp-project/qxmpp/archive/v$pkgver/qxmpp-v$pkgver.tar.gz"
subpackages="$pkgname-dev"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	# tst_qxmppiceconnection and tst_qxmpptransfermanager require a network connection
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E "(tst_qxmppiceconnection|tst_qxmpptransfermanager)"
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="af768099ea73d73f3f8e835018eee027a5b75e45ef1eb4985411116665468c4747c6a3adbd3582f6452630cd6824797a17f03fa73a208fe7cfa2d7a8c9ea5dc3  qxmpp-v1.3.1.tar.gz"
